﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Config.ascx.cs" Inherits="NLLSite.Administrator.UserControl.Config" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>

<%@ Register src="DemoPopupFile.ascx" tagname="DemoPopupFile" tagprefix="uc1" %>


<script type="text/javascript" src="../../ckfinder/ckfinder.js"></script>
<script type="text/javascript">

    function BrowseServer() {
        // You can use the "CKFinder" class to render CKFinder in a page:
        var finder = new CKFinder();
        finder.basePath = '../../ckfinder/'; // The path for the installation of CKFinder (default = "/ckfinder/").
        finder.selectActionFunction = SetFileField;
        finder.popup();

        // It can also be done in a single line, calling the "static"
        // popup( basePath, width, height, selectFunction ) function:
        // CKFinder.popup( '../', null, null, SetFileField ) ;
        //
        // The "popup" function can also accept an object as the only argument.
        // CKFinder.popup( { basePath : '../', selectActionFunction : SetFileField } ) ;
    }

    // This is a sample function which is called when a file is selected in CKFinder.
    function SetFileField(fileUrl) {
        document.getElementById('ctl00_ContentPlaceHolderCenter_Config1_txtFile').value = fileUrl;
        //Element ID = Ten class usercontrol + 1 + ID cua text box.
    }

</script>

<div class="box box-100">
    <div class="boxin">
        <div class="header">
            <h3>
                 Thiết đặt site</h3>
        </div>
        <div style="padding: 18px;">
            <!--<form class="basic" action="" method="post" enctype="multipart/form-data"><!-- Default basic forms -->
            <div class="inner-form">
                <asp:Panel ID="Panel1" runat="server">
                    <table><tr>
                            <td>
                                &nbsp;</td>
                            <td>
                                <asp:Label ID="Label1" runat="server" ForeColor="Red"></asp:Label>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                Đường dẫn icon:</td>
                            <td>
                                <asp:TextBox ID="txtFile" runat="server" AutoPostBack="True" Width="250px"></asp:TextBox>
                                <input type="button" value="Browse Server" onclick="BrowseServer();" class="altbutton" />
                            </td>
                            <td>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                    ErrorMessage="(*)" ControlToValidate="txtFile"></asp:RequiredFieldValidator>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Footer:</td>
                            <td>
                                <CKEditor:CKEditorControl ID="ckeditorFooter" runat="server" 
                                    basePath="../../ckeditor/" Width="600px"></CKEditor:CKEditorControl>
                            </td>
                            <td>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                    ControlToValidate="ckeditorFooter" ErrorMessage="(*)"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Share Icon</td>
                            <td><CKEditor:CKEditorControl ID="CKEditorShareIcon" runat="server" 
                                    basePath="../../ckeditor/" Width="600px"></CKEditor:CKEditorControl>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                Tiêu đề trang chủ</td>
                            <td>
                                <asp:TextBox ID="txtTitle" runat="server" Width="270px"></asp:TextBox>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                Meta title</td>
                            <td>
                                <asp:TextBox ID="txtMetaTitle" runat="server" Width="270px"></asp:TextBox>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                MetaDescription</td>
                            <td>
                                <asp:TextBox ID="txtMetaDescription" runat="server" TextMode="MultiLine" 
                                    Width="270px"></asp:TextBox>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                MetaKeywords</td>
                            <td>
                                <asp:TextBox ID="txtKeywords" runat="server" TextMode="MultiLine" Width="270px"></asp:TextBox>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                MetaRobots</td>
                            <td>
                                <asp:TextBox ID="txtMetaRobots" runat="server" Width="270px"></asp:TextBox>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                MetaAuthor</td>
                            <td>
                                <asp:TextBox ID="txtMetaAuthor" runat="server" Width="270px"></asp:TextBox>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                            <td>
                                <asp:Button ID="Button1" runat="server" Text="Lưu lại" CssClass="altbutton" 
                                    onclick="Button1_Click" />
                                <a href="Default.aspx"><input type="button" value="Thoát" class="altbutton" /></a>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </div>
        </div>
    </div>
</div>


